<?php

namespace app\admin\model\validate;

use think\Validate;

class Album extends Validate {
    protected $rule =   [
        'applet_id'  => 'require',
        //'open_id' => 'require',
        'title' => 'require|max:50',
        'skin' => 'require|max:20',
        //'content' => 'require',
        //'music_id' => 'require',
        'music_name' => 'max:20',
        'music_url' => 'max:255',
        'thumb' => 'require|max:500',
        'share_img_url' => 'max:255',
        'share_title' => 'max:40',
        'avatar_url' => 'require|max:225',
        'nick_name' => 'require|max:24',
        'click_num' => 'number',
        'share_num' => 'number',
        'sort' => 'number',
        //'applet_name' => 'require|max:40',
        'skin_title' => 'require|max:50',
        //'is_show' => 'number',
        //'type' => 'number',
    ];

    protected $message  =   [
        'applet_id.require' => '小程序不能为空',
        'applet_name.require' => '小程序不能为空',
        'title.require' => '相册标题不能为空',
        'title.max' => '相册标题不能超过50个字符',
        'skin.require'     => '相册模板不能为空',
        'skin.max'     => '相册模板不能超过20个字符',
        //'content'     => '相册内容不能为空',
        //'music_id' => '相册背景音乐不能为空',
        //'music_name.require' => '相册背景音乐不能为空',
        'music_name.max' => '相册背景音乐不能超过20个字符',
        'thumb'     => '相册封面不能为空',
        'share_title.max'     => '分享标题不能超过40个字符',
        'share_img_url.max'     => '分享封面不能超过255个字符',
        'avatar_url.require'     => '用户头像不能为空',
        'avatar_url.max'     => '用户头像不能超过225个字符',
        'nick_name.require'     => '昵称不能为空',
        'nick_name.max'     => '昵称不能超过24个字符',
        'click_num.number'     => '点击次数必须是数字',
        'share_num.number'     => '分享次数必须是数字',
        'sort.number' => '排序必须是数字',
        //'applet_name.max' => '小程序名称不超过40个字符',
        'skin_title.require' => '模板不能为空',
        'skin_title.max' => '模板标题不超过40个字符',

    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}